package com.example.demo.service.impl;

import com.example.demo.mapper.PhotoMapper;
import com.example.demo.pojo.PhotoPoJo;
import com.example.demo.service.PhotoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author T480
 */
@Service
public class PhotoServiceImpl implements PhotoService {

//    @Resource
//    private PhotoMapper photoMapper;
    @Override
    public Boolean add(MultipartFile file) {
        PhotoPoJo photoPoJo = new PhotoPoJo();
        try {

            InputStream inputStream = file.getInputStream();

            byte[] bytes = file.getBytes();
            int available = inputStream.available();
//            photoMapper.insert()
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        return null;
    }
}
